lst = [54, 55, 48, 97, 3, 62, 12]

# (1) 排序操作
asc_lst = sorted(lst)
print('升序：', asc_lst)       # 升序： [3, 12, 48, 54, 55, 62, 97]
desc_lst = sorted(lst, reverse=True)
print('降序：', desc_lst)      # 降序： [97, 62, 55, 54, 48, 12, 3]

# (2) reversed 反向
new_lst = reversed(lst)
print('类型：', type(new_lst))        # 类型： <class 'list_reverseiterator'>   迭代器对象
print('反向：', list(new_lst))        # 反向： [12, 62, 3, 97, 48, 55, 54]

# (3) zip
x = ['a', 'b', 'c', 'd']
y = [10, 20, 30, 40]
zip_obj = zip(x, y)
print(type(zip_obj))                 # <class 'zip'>
print(list(zip_obj))                 # [('a', 10), ('b', 20), ('c', 30), ('d', 40)]

# (4) enumerate
enum = enumerate(y, start=1)
print(type(enum))                    # <class 'enumerate'>
print(tuple(enum))                   # ((1, 10), (2, 20), (3, 30), (4, 40))

# (5) all
lst2 = [10, 20, '', 40]
print(all(lst2))                     # False
print(all(lst))                      # True

# (6) any
print(any(lst2))                     # True

# (7)
x1 = ['a', 'b', 'c', 'd']
y1 = [10, 20, 30, 40]
zip2 = zip(x1, y1)
print(next(zip2))                    # ('a', 10)
print(next(zip2))                    # ('b', 20)
print(next(zip2))                    # ('c', 30)
print(next(zip2))                    # ('d', 40)
# print(next(zip2))                    # 报错：Traceback (most recent call last):

